#ifndef ZL_STREAM_INTERFACE
#define ZL_STREAM_INTERFACE
#include "../Basic/Basic.h"

namespace zl
{
	namespace stream
	{
		class IStream :public virtual Interface
		{
		public:
			virtual bool					CanRead()const = 0;
			virtual bool					CanWrite()const = 0;
			virtual bool					CanSeek()const = 0;
			virtual bool					CanPeek()const = 0;
			virtual bool					IsLimited()const = 0;
			virtual bool					IsAvailable()const = 0;
			virtual void					Close() = 0;
			virtual pos_t					Position()const = 0;
			virtual pos_t					Size()const = 0;
			virtual void					Seek(pos_t _size) = 0;
			virtual void					SeekFromBegin(pos_t _size) = 0;
			virtual void					SeekFromEnd(pos_t _size) = 0;
			virtual size_t					Read(void* _buffer, zint _size) = 0;
			virtual size_t					Write(void* _buffer, zint _size) = 0;
			virtual size_t					Peek(void* _buffer, zint _size) = 0;
		};
		class IEncoder :public Interface
		{
		public:
			virtual void                    Setup(IStream* _stream) = 0;
			virtual void                    Close() = 0;
			virtual zint                    Write(void* _buffer, zint _size) = 0;
		};
		class IDecoder :public Interface
		{
		public:
			virtual void                    Setup(IStream* _stream) = 0;
			virtual void                    Close() = 0;
			virtual zint                    Read(void* _buffer, zint _size) = 0;
		};
	};
};
#endif